package file1;

import java.io.*;

public class Demo7 {
    public static void main(String[] args) throws IOException {
        //通过字符流文件路径打开一个文件
        Reader reader=new FileReader("./test.txt");
        char[]array=new char[10];
        int len=reader.read(array);
        System.out.println("读取到 "+len+"个字符");
        for (int i = 0; i < len; i++) {
            System.out.print(array[i]);
        }
        reader.close();
    }
}
